package airAgent.group2;


import java.util.ResourceBundle;

import ontology.ontology.AirAgentOntology;

import jade.content.lang.Codec;
import jade.content.lang.sl.SLCodec;
import jade.content.onto.Ontology;
import jade.core.Agent;
import jade.wrapper.AgentController;
import jade.wrapper.StaleProxyException;



public class Simulation2 extends Agent{
	private static final long serialVersionUID = 1L;
	private ResourceBundle rb = ResourceBundle.getBundle("airAgent.group2.configuration");
	
	private static Codec codec = new SLCodec();
    static Ontology ontology = AirAgentOntology.getInstance();
    
    //Unique number for the clients.

	
	
	protected void setup(){
		getContentManager().registerLanguage(codec);
		getContentManager().registerOntology(ontology);
		
		startAgent(this, "TIMER", rb.getString("TIMER"));
		startAgent(this, "BANK", rb.getString("BANK"));
		
		startAgent(this, "CGENERATOR", "airAgent.group2.ClientGenerator");
		
		
//		startAgent("A1", rb.getString("AIRLINE"));
//		startAgent("A2", "airAgent.group1.Airline1");
//		doWait(500);
		
		
		
		


		
		
		
		
		
		

		//startAgent("AIR 2", rb.getString("AIRLINE"));
		//startAgent("AIR 1", rb.getString("AIRLINE"));
	}
	
	public static void startAgent(Agent myAgent, String name, String agent){
		try {
			AgentController a = myAgent.getContainerController().createNewAgent(name, agent, null);
			a.start();
		} catch (StaleProxyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}